package file;

import java.io.File;
import java.io.FileFilter;

public class ListFilesDemo2 {
    public static void main(String[] args) {
        File dir =new File(".");
        if (dir.isDirectory()){
            FileFilter filter = new FileFilter() {
            public boolean accept(File f){return f.getName().startsWith(".");}
        };
        File[] subs =dir.listFiles(filter);
        for (File sub:subs){
            System.out.println(sub.getName());
        }
    }
}
    }